/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.servinf.ani.sincronizador.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author David
 */
@Entity
@Table(name = "social")
@NamedQueries({
    @NamedQuery(name = "Social.findAll", query = "SELECT s FROM Social s")})
public class Social implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_social")
    private Integer idSocial;
    @Column(name = "estado_tramite")
    private String estadoTramite;
    @Column(name = "actores")
    private String actores;
    @Column(name = "fecha_radicacion")
    @Temporal(TemporalType.DATE)
    private Date fechaRadicacion;
    @Column(name = "fecha_pronunciamiento")
    @Temporal(TemporalType.DATE)
    private Date fechaPronunciamiento;
    @JoinColumn(name = "id_intervencion", referencedColumnName = "id_intervencion")
    @OneToOne
    private Intervencion idIntervencion;

    public Social() {
    }

    public Social(Integer idSocial) {
        this.idSocial = idSocial;
    }

    public Integer getIdSocial() {
        return idSocial;
    }

    public void setIdSocial(Integer idSocial) {
        this.idSocial = idSocial;
    }

    public String getEstadoTramite() {
        return estadoTramite;
    }

    public void setEstadoTramite(String estadoTramite) {
        this.estadoTramite = estadoTramite;
    }

    public String getActores() {
        return actores;
    }

    public void setActores(String actores) {
        this.actores = actores;
    }

    public Date getFechaRadicacion() {
        return fechaRadicacion;
    }

    public void setFechaRadicacion(Date fechaRadicacion) {
        this.fechaRadicacion = fechaRadicacion;
    }

    public Date getFechaPronunciamiento() {
        return fechaPronunciamiento;
    }

    public void setFechaPronunciamiento(Date fechaPronunciamiento) {
        this.fechaPronunciamiento = fechaPronunciamiento;
    }

    public Intervencion getIdIntervencion() {
        return idIntervencion;
    }

    public void setIdIntervencion(Intervencion idIntervencion) {
        this.idIntervencion = idIntervencion;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idSocial != null ? idSocial.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Social)) {
            return false;
        }
        Social other = (Social) object;
        if ((this.idSocial == null && other.idSocial != null) || (this.idSocial != null && !this.idSocial.equals(other.idSocial))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.servinf.sincronizador.ani.entities.Social[ idSocial=" + idSocial + " ]";
    }
    
}
